<?php
/**
 *	This file is part of SteamProfile.
 *
 *	Written by Nico Bergemann <barracuda415@yahoo.de>
 *	Copyright 2008 Nico Bergemann
 *
 *	SteamProfile is free software: you can redistribute it and/or modify
 *	it under the terms of the GNU General Public License as published by
 *	the Free Software Foundation, either version 3 of the License, or
 *	(at your option) any later version.
 *
 *	SteamProfile is distributed in the hope that it will be useful,
 *	but WITHOUT ANY WARRANTY; without even the implied warranty of
 *	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *	GNU General Public License for more details.
 *
 *	You should have received a copy of the GNU General Public License
 *	along with SteamProfile.  If not, see <http://www.gnu.org/licenses/>.
 */
 
// check php version
if(!function_exists('version_compare') || version_compare(PHP_VERSION, '5.0.0', '<'))
	die('This script requires PHP 5.0.0 or higher!');

// includes
require 'data/config.php';
require 'data/includes/main.php';

// check for html rendering flag
if(!isset($html))
	$html = (isset($_GET['html']) && (bool)$_GET['html'])? true : false;

if($html)
{
	require 'data/includes/class.SteamProfileHTMLApp.php';
	$app = new SteamProfileHTMLApp();
}
else
{
	require 'data/includes/class.SteamProfileImageApp.php';
	$app = new SteamProfileImageApp();
}

try
{
	$app->SetConfig($config);
	$app->Run();
}
catch(Exception $e)
{
	die('Failed to start SteamProfile: '.$e->getMessage());
}
?>
